package domian;

import pojo.classentity.Class;
import pojo.other.other;
import pojo.subjectentity.subjetctinfo;
import pojo.users.Findpassword;
import pojo.users.Login;
import pojo.users.Register;
import uilt.Scan;

public class test {
	Login login = new Login();
	Register register = new Register();
	Findpassword findpassword = new Findpassword();
	subjetctinfo subinfo = new subjetctinfo();
	other o =new other();
	Scan sc = new Scan();
	Class c = new Class();

	public boolean menu() throws Exception {
		int i,j;
		while(true){
			System.out.println("******欢迎来到智慧教辅系统******");
			System.out.println("1.登录");
			System.out.println("2.注册");
			System.out.println("3.忘记密码");
			System.out.print("请输入:");
			i= sc.getkey();

			if( i == 1 ){
				Boolean b=login.tologin();

				while (b){
					System.out.println("*******欢迎进入智慧教辅系统******");
					System.out.println("1.班级模块");
					System.out.println("2.课程模块");
					System.out.println("3.其他模块");
					System.out.print("请输入:");
					j = sc.getkey();
					if(j == 1){
						c.menu();
					}
					else if( j == 2){
						subinfo.menu();
					}
					else if(j == 3){
						o.menu();
					}else {
						break;
					}
				}
			}
			else if(i == 2){
				register.tologin();
			}
			else if (i == 3){
				findpassword.tofindpassword();
			}
			else {
				return false;
			}
		}
	}

	public static void main(String[] args) throws Exception {
		test t = new test();
		do{

		}while (t.menu());
	}
}